package demo.method.impl;


import demo.data.Data;
import demo.method.ShopMethod;
import demo.model.Shop;

import java.util.List;

public class ShopMethodImpl implements ShopMethod {

    @Override
    public Shop getShopById(long id) {
        List<Shop> shopList = Data.getShopData();
        return shopList.stream().filter(shop -> shop.getId() == id).findAny().orElse(new Shop());
    }
}
